#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include<stdlib.h>
void child_code(int delay) {
    sleep(delay);
    exit(0);
}

void parent_code(int *status) {
    wait(status);
}

int main() {
    pid_t pid;
    int status;

    printf("before : my pid is %d\n", getpid());
    pid = fork();

    if (pid == 0) {
        child_code(1000);
    } else if (pid > 0) {
        parent_code(&status);
    }

    return 0;
}
